package forms;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import domain.DomainEntity;

@Entity
@Access(AccessType.PROPERTY)
public class RouteForm extends DomainEntity {

	// Constructors
	public RouteForm() {
		super();
	}

	// Attributes
	private String name;
	private Double length;
	private int difficulty;
	
	private Double rating;
	private int eventId;

	@NotBlank
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	@Digits(integer = 5, fraction = 2)
	@Min(0)
	public Double getLength() {
		return length;
	}

	public void setLength(Double length) {
		this.length = length;
	}
	@Range(min = 0, max = 100)
	public int getDifficulty() {
		return difficulty;
	}

	public void setDifficulty(int difficulty) {
		this.difficulty = difficulty;
	}
	@Digits(integer = 3, fraction = 2)
	@Range(min = 0, max = 100)
	public Double getRating() {
		return rating;
	}

	public void setRating(Double rating) {
		this.rating = rating;
	}

	public int getEventId() {
		return eventId;
	}

	public void setEventId(int eventId) {
		this.eventId = eventId;
	}

}
